﻿package code {
	
	public class Vertex {
		
		public var x:Number;
		public var y:Number;
		
		public function Vertex(x:Number,y:Number) {
			this.x=x;
			this.y=y;
		}
		
		public static function add(p:Vertex,q:Vertex):Vertex {
			return new Vertex(p.x+q.x,p.y+q.y);
		}
		
		public static function sub(p:Vertex,q:Vertex):Vertex {
			return new Vertex(q.x-p.x,q.y-p.y);
		}
		
		public function toString():String {
			return "("+x+","+y+")";
			
		}
	}
}